#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
int main()
{
pid_t pid = fork();
 if(pid<0)
 {
     printf("创建进程失败！\n");
 }
 else if(pid==0)
 {
     printf("我是子进程:PID:%d，PPID:%d\n",getpid(),getppid());
 }
 else 
 {
     printf("我是父进程:PID:%d，PPID:%d\n",getpid(),getppid());

 }
 return 0;
}
